﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using bdtheque.data.interfaces;
using bdtheque.data.poco;

namespace bdtheque.data.dataaccess
{
	public class BdthequeUnitOfWork : UnitOfWork
	{
		public BdthequeUnitOfWork(string connectionString)
		{
            // Creation of the coresponding DataContext
            base.Context = new BdthequeDataContext(connectionString);

        	// Repository Allocations
            base.AddRepository(new Repository<Author>(base.Context));
            base.AddRepository(new Repository<Comic>(this.Context));
            base.AddRepository(new Repository<ComicSeries>(this.Context));
            base.AddRepository(new Repository<Parameter>(this.Context));
            base.AddRepository(new Repository<Profile>(this.Context));
            base.AddRepository(new Repository<Publisher>(this.Context));
            base.AddRepository(new Repository<User>(this.Context));
            base.AddRepository(new Repository<UserCollection>(this.Context));
		}
	}
}
